<extend name="Public/base"/>

<block name="body">
    <div class="main-title">
        <h2>{$meta_title}</h2>
    </div>
    <form action="{:U('Common/addCommon')}" method="post" class="form-horizontal">
        <div class="form-item">
            <label class="item-label">上级分类</label>
            <div class="controls">
            <select name="pid">
                <option value="0" selected="">顶级分类</option>
                <volist name="_class" id="v">
                    <option value="{$v.id}" <if condition="$v['id'] eq $pid">selected="selected"<elseif condition="($data['pid'] gt 0) and ($v['id'] eq $data['pid'])" />selected="selected"</if>>{$v.name}</option>          
                </volist>
            </select>               
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">分类名</label>
            <div class="controls">
                <input type="text" class="text input-large" name="name" value="{$data.name|default=''}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">配送费</label>
            <div class="controls">
                 <label class="radio">
                    <input type="radio" value="0" name="is_patch" <if condition="$data['is_patch'] eq 0">checked="checked"</if>>无                                    
                </label>
                <label class="radio">
                    <input type="radio" value="1" name="is_patch" <if condition="$data['is_patch'] eq 1">checked="checked"</if>>有
                </label>
            </div>
        </div>
        <div class="form-item">
            <input type="hidden" name="table" value="goods_class">
            <input type="hidden" name="methods" value="GoodsClass">
            <input type="hidden" name="fields" value="pid,text;name,text;is_patch,text">
            <input type="hidden" name="params" value="id,{$pid}">
            <input type="hidden" name="id" value="{$data.id|default=0}">
            <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('GoodsClass/index')}');
    </script>
</block>
